package core.threadpool;

import java.util.LinkedList;

public class PoolQueue<E> extends LinkedList<E> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Override
	public synchronized E getFirst() {
		return super.getFirst();
	}
	
	@Override
	public synchronized void addLast(E e) {
		super.addLast(e);
	}
	
	@Override
	public synchronized int size() {
		return super.size();
	}
	
	@Override
	public synchronized E removeFirst() {
		return super.removeFirst();
	}
	
	@Override
	public synchronized E remove(int index) {
		return super.remove(index);
	}
	
	public E dequeue(){
		E e;
		try {
			e = remove(0);
		} catch (IndexOutOfBoundsException ex) {
			e = null;
		}
		return e;
	}
	
	@Override
	public synchronized boolean remove(Object o) {
		return super.remove(o);
	}
}
